@import '../mixin.scss';
// 弹窗组件样式 - 仿造 el-dialog
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
  
  &.show {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.dialog {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  width: 1000px;
  max-width: 95%;
  max-height: 90%;
  overflow: hidden;
  transform: scale(0.7);
  opacity: 0;
  transition: all 0.3s;
  
  &.show {
    transform: scale(1);
    opacity: 1;
  }
}

.dialog-header {
  padding: 20px 20px 10px;
  border-bottom: 1px solid #ebeef5;
  
  .dialog-title {
    line-height: 24px;
    font-size: 18px;
    color: #303133;
    margin: 0;
  }
  
  .dialog-close {
    position: absolute;
    top: 12px;
    right: 20px;
    padding: 0;
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 26px;
    color: #909399;
    
    &:hover {
      color: #409eff;
    }
  }
}

.dialog-body {
  padding: 30px 20px;
  color: #606266;
  font-size: 14px;
  word-break: break-all;
  max-height: 60vh;
  overflow-y: auto;
  @include scrollBar;
}

.dialog-footer {
  padding: 10px 20px 20px;
  text-align: right;
  box-sizing: border-box;
  border-top: 1px solid #ebeef5;
  
  .dialog-btn {
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    background: #fff;
    border: 1px solid #dcdfe6;
    color: #606266;
    text-align: center;
    box-sizing: border-box;
    outline: none;
    margin: 0;
    transition: 0.1s;
    font-weight: 500;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 4px;
    margin-left: 10px;
    
    &:hover {
      color: #409eff;
      border-color: #c6e2ff;
      background-color: #ecf5ff;
    }
    
    &.primary {
      color: #fff;
      background-color: #409eff;
      border-color: #409eff;
      
      &:hover {
        background: #66b1ff;
        border-color: #66b1ff;
        color: #fff;
      }
    }
  }
}

// 弹窗内表格样式
.dialog-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  border: 1px solid #ebeef5;
  border-radius: 6px;
  overflow: hidden;
  
  th, td {
    border-bottom: 1px solid #ebeef5;
    padding: 16px 12px;
    text-align: left;
    font-size: 14px;
  }
  
  // 操作列样式
  th:last-child, td:last-child {
    width: 80px;
    text-align: center;
    padding: 12px 8px;
  }
  
  th {
    color: #303133;
    font-weight: 600;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #409eff;
  }
  
  td {
    color: #606266;
    background-color: #fff;
    transition: background-color 0.2s;
  }
  
  tbody tr:hover td {
    background-color: #f5f7fa;
  }
  
  tbody tr:last-child td {
    border-bottom: none;
  }
  
  .table-input {
    width: 100%;
    height: 40px;
    padding: 0 16px;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
    outline: none;
    font-size: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    
    &:focus {
      border-color: #409eff;
      background: #ffffff;
      box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.15), 0 4px 12px rgba(64, 158, 255, 0.1);
      transform: translateY(-1px);
    }
    
    &:hover {
      border-color: #909399;
      background: #ffffff;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    &::placeholder {
      color: #c0c4cc;
      font-style: italic;
    }
  }
  
  .table-select {
    width: 100%;
    height: 40px;
    padding: 8px 35px 8px 12px;
    border: 2px solid #dcdfe6;
    border-radius: 8px;
    font-size: 14px;
    color: #606266;
    background-color: #ffffff;
    transition: all 0.3s ease;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23C0C4CC" d="M6 8L0 2h12z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;

    &:hover {
      border-color: #c0c4cc;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23409EFF" d="M6 8L0 2h12z"/></svg>');
    }

    &:focus {
      border-color: #409eff;
      box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
      background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23409EFF" d="M6 8L0 2h12z"/></svg>');
    }
  }
  
  .delete-btn {
    background: #f56c6c;
    border: 1px solid #f56c6c;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    
    &:hover {
      background: #f78989;
      border-color: #f78989;
      transform: translateY(-1px);
      box-shadow: 0 4px 8px rgba(245, 108, 108, 0.3);
    }
    
    &:active {
      transform: translateY(0);
    }
  }
}

.add-row-btn {
  margin-top: 20px;
  background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%);
  border: 1px solid #409eff;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
  
  &:hover {
    background: linear-gradient(135deg, #66b1ff 0%, #409eff 100%);
    border-color: #66b1ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(64, 158, 255, 0.4);
  }
  
  &:active {
    transform: translateY(0);
  }
}

// 空状态提示
.empty-state {
  text-align: center;
  padding: 40px 0;
  color: #909399;
  font-size: 14px;
}